<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.bis.framework.util.common.SystemConfig;"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<!-- Header -->
<jsp:include page="/clear/page/common/co_header.jsp" flush="true" />

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<script type="text/javascript">
    /**
     *
     * 验证码框架共通-更新验证码。kaptcha
     */
    function upd_CheckCode(source) {
        var url = "<%=SystemConfig.getCheckCodeUrl()%>/kaptcha.jpg?";
        source.src = url + Math.floor(Math.random() * 100);
    }
</script>

</head>
<body>
    <form method="POST">
        <table>
            <tr>
                <td>
                    <img id="kaptchaImg" src="<%=SystemConfig.getCheckCodeUrl()%>/kaptcha.jpg" title="看不清，点击换一张"
                    onclick="upd_CheckCode(this)" style="cursor: pointer; float: left;" />
                </td>
                <td valign="top">
                    <br>sec code:<input type="text" name="kaptchafield"><br />
                </td>
                <td>
                    <input type="submit" name="submit">
                </td>
            </tr>
        </table>
    </form>

    <%
        String c = (String) session
    					.getAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY);
    			String parm = (String) request.getParameter("kaptchafield");

    			out.println("Parameter: " + parm + " ? Session Key: " + c + " : ");

    			if (c != null && parm != null) {
    				if (c.equals(parm)) {
    					out.println("<b>true</b>");
    				} else {
    					out.println("<b>false</b>");
    				}
    			}
    %>
</body>
</html>